<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <!-- 打印1到100, 遇到3的倍数则打印3的倍数, 遇到5的倍数则打印5的倍数, 遇到3和5的公倍数, 则打印3和5的公倍数 -->
    <script>
      var arr = []
      var res = []
      var arrRes = []
      for (var i = 1; i <= 100; i++) {
        if (i % 3 == 0) arr.push(i)
        if (i % 5 == 0) res.push(i)
        if (i % 3 != 0 && i % 5 != 0) arrRes.push(i)
      }
      console.log('3的倍数' + arr)
      console.log('5的倍数' + res)
      console.log('3和5的公倍数' + arrRes)
    </script>
  </body>
</html>
